package com.myway.dto.util;

import java.math.BigDecimal;

/**
 * Created by qianmi-05 on 2018/12/21.
 */
public class PageUtil {
    
    //根据总条数获和每页显示条数获取当前页
    public static int getCurrentPage(int total,int pageSize){
        if(total==0){
            return  1;
        }
        return new BigDecimal(total).divide(new BigDecimal(pageSize),0,BigDecimal.ROUND_CEILING).intValue()+1;
    }

}
